<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      #div1,
      #div2,
      #div3 {
        border: solid;
        background: yellowgreen;
        font-size: 3rem;
        width: 400px;
      }
    </style>
  </head>
  <body>
    <div id="div1">div1</div>
    <div id="div2" style="height: 20px"></div>
    <div id="div3">div3</div>
    <script>
      const div1 = document.getElementById("div1");
      const div2 = document.getElementById("div2");

      div1.onmouseout = function (e) {
        console.log("onmouseover", e.target);
        console.log("onmouseover", e.relatedTarget);
      };
    </script>
  </body>
</html>
